package com.xiaoxu.intranetweb.mybatisplusSzappdb.controller.gps;


import com.xiaoxu.intranetweb.mybatisplusSzappdb.entity.Gps18DeviceList;
import com.xiaoxu.intranetweb.mybatisplusSzappdb.service.impl.Gps18DeviceListServiceImpl;
import com.xiaoxu.intranetweb.util.SzResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author lvNuo
 * @since 2025-04-01
 */
@RestController
@RequestMapping("/gps18DeviceList")
public class Gps18DeviceListController {
    @Autowired
    private Gps18DeviceListServiceImpl gps18DeviceListService;

    @GetMapping("/getGps18DeviceList")
    public SzResult getList(
            @RequestParam(value = "page", required = false) Integer page,
            @RequestParam(value = "pageSize", required = false) Integer pageSize,
            @RequestParam(value = "macNumber", required = false) Integer macNumber,
            @RequestParam(value = "fullname", required = false) String fullname) throws Exception {
        return gps18DeviceListService.getList(page, pageSize, macNumber, fullname);
    }

    @PostMapping("/addGps18DeviceList")
    public SzResult add(@RequestBody Gps18DeviceList gps18DeviceList){
        return gps18DeviceListService.add(gps18DeviceList);
    }

    @PostMapping("/editGps18DeviceList")
    public SzResult edit(@RequestBody Gps18DeviceList gps18DeviceList){
        return gps18DeviceListService.edit(gps18DeviceList);
    }
    @GetMapping("/deleteGps18DeviceList")
    public SzResult del(@RequestParam(value = "objectid", required = false) String objectid){
        return gps18DeviceListService.del(objectid);
    }
}
